﻿<Window x:Class="SABnzbdNET.Views.MainView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:uc="clr-namespace:SABnzbdNET.Views"
    xmlns:tb="http://www.hardcodet.net/taskbar"
    Title="SABnzbdNET" Height="505" Width="600" Icon="pack://application:,,,/Graphics/SABnzbd.ico" ResizeMode="CanMinimize" WindowState="Normal" WindowStartupLocation="CenterScreen"
    StateChanged="OnStateChanged" IsVisibleChanged="OnIsVisibleChanged" Loaded="WindowLoaded">
    <Window.TaskbarItemInfo>
        <TaskbarItemInfo Description="SABnzbdNET" ThumbnailClipMargin="5">
            <TaskbarItemInfo.ThumbButtonInfos>
                <ThumbButtonInfoCollection>
                    <ThumbButtonInfo x:Name="btnThumbRefresh" DismissWhenClicked="False"
                                     Description="Refresh" Command="{Binding Path=RefreshCommand}"
                                     ImageSource="/SABnzbdNET;component/Graphics/Toolbar/Refresh.ico" />
                    <ThumbButtonInfo x:Name="btnThumbStart" DismissWhenClicked="False" 
                                     Description="Start" Command="{Binding Path=StartCommand}"
                                     ImageSource="/SABnzbdNET;component/Graphics/Toolbar/Download.ico" />
                    <ThumbButtonInfo x:Name="btnThumbPause" DismissWhenClicked="False"
                                     Description="Pause" Command="{Binding Path=PauseCommand}"
                                     ImageSource="/SABnzbdNET;component/Graphics/Toolbar/Close.ico" />
                </ThumbButtonInfoCollection>
            </TaskbarItemInfo.ThumbButtonInfos>
        </TaskbarItemInfo>
    </Window.TaskbarItemInfo>
    <Grid>
        <uc:ToolbarView x:Name="ToolbarView" Margin="0,0,0,0" VerticalAlignment="Top" />
        <TabControl Margin="10,70,10,35" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" SelectedIndex="{Binding Path=TabIndex}">
            <TabItem Header="Server info">
                <uc:ServerInfoView x:Name="ServerInfoView" VerticalAlignment="Stretch" />
            </TabItem>
            <TabItem Header="Server History">
                <uc:ServerHistoryView x:Name="ServerHistoryView" VerticalAlignment="Stretch" />
            </TabItem>
            <TabItem Header="Server Warnings">
                <uc:WarningsView x:Name="WarningsView" VerticalAlignment="Stretch" />
            </TabItem>
        </TabControl>
        <StatusBar Height="25" Margin="0,0,0,0" Name="statusBar" VerticalAlignment="Bottom" ToolTip="{Binding Path=StatusMessage}">
            <StatusBarItem>
                <TextBlock Name="textError" Text="{Binding Path=StatusMessage}" ToolTip="{Binding Path=StatusMessage}"></TextBlock>
            </StatusBarItem>
        </StatusBar>
        <tb:TaskbarIcon x:Name="NotifyIcon" IconSource="pack://application:,,,/Graphics/SABnzbd.ico" Visibility="Collapsed" 
                        ToolTipText="{Binding Path=NotifyIconTooltip}"
                        DoubleClickCommand="{Binding Path=RestoreCommand}">
            <tb:TaskbarIcon.ContextMenu>
                <ContextMenu>
                    <MenuItem Header="Restore SABnzbdNET" Command="{Binding Path=RestoreCommand}" />
                    <MenuItem Header="Refresh server info" Command="{Binding Path=RefreshCommand}" />
                    <MenuItem Header="Start server" Command="{Binding Path=StartCommand}" />
                    <MenuItem Header="Pause server" Command="{Binding Path=PauseCommand}" />
                    <MenuItem Header="Close SABnzbdNET" Command="{Binding Path=CloseApplicationCommand}" />
                </ContextMenu>
            </tb:TaskbarIcon.ContextMenu>
            <tb:TaskbarIcon.TrayToolTip>
                <Border Background="White" BorderBrush="Gray" BorderThickness="1" CornerRadius="4">
                    <StackPanel Margin="10" Orientation="Horizontal" FlowDirection="LeftToRight">
                        <TextBlock Text="{Binding Path=NotifyIconTooltip}" VerticalAlignment="Top" />
                        <Image Height="60" Opacity="0.25" Stretch="Uniform" VerticalAlignment="Top" Margin="10,0,0,0">
                            <Image.Source>
                                <BitmapImage UriSource="/SABnzbdNET;component/Graphics/SABnzbd.jpg"></BitmapImage>
                            </Image.Source>
                        </Image>
                    </StackPanel>
                </Border>
            </tb:TaskbarIcon.TrayToolTip>
        </tb:TaskbarIcon>
    </Grid>
</Window>
